-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added JsonObject method isEmpty() #2233
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this pull request!
Could you please for completeness sake also add a small test to JsonObjectTest
?
Your argument about consistency with JsonArray.isEmpty()
is reasonable, but on the other hand the question might be how many Map
convenience methods we want to add, see also related #1667 (comment).
268cee7
to
ec19d71
Compare
I feel that Other |
ec19d71
to
90db072
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about it ?
Given that we already have both |
* Added isEmpty() * Fixed Javadoc typo * Changed test to use assertTrue() and assertFalse() (cherry picked from commit ceb3b87)
Code change
Added JsonObject method
isEmpty()
.Rationale
There are scenarios where there is a need to check whether a
JsonObject
contains any key/value pairs.This mirrors the existing functionality of
JsonArray.isEmpty()